package org.itboys.mobile.entity.mysql.order;

import org.itboys.commons.utils.time.TimeUtils;
import org.itboys.mongodb.entity.BaseMySqlEntity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 作者：zzq
 * 时间：2017/12/5
 * 描述：迈迪龙_订单
 */
public class MdlOrder extends BaseMySqlEntity{
    //基础信息
    private String orderNo;//订单编号
    private Integer type;//1，商城，2积分,3采购
    private BigDecimal totalAmount;//订单金额应付(钱或积分)
    private BigDecimal payAmount;//订单金额实付(钱或积分)
    //private BigDecimal retailAmount;//订单零售价格。
    private Integer payType;//付款方式,1支付宝，2微信，
    private Integer sendType;//配送类型 1. 普通 2. 快递
    private String payNo;//付款流水号
    private Integer orderStatus;//订单状态
    private String receiveName;//收货人
    private String receiveMobile;//收货电话
    private String receiveAddress;//收货地址
    private Long memberId;//购买人Id;
    private String memberName;//购买人昵称
    private Long salesManId;//销售员id
    private String salesManName;//销售员名称
    private Long agentId;//代理商id
    private String agentName;//代理商名称
    //其他属性
    private BigDecimal sendAmount;//配送费

    private BigDecimal aliPayAmount;//支付宝支付金额。统计使用
    private BigDecimal wechatPayAmount;//微信支付金额。统计使用
    private BigDecimal wechatHtmlPayAmount;//微信公众号支付金额。统计使用
    private BigDecimal linePayAmount;//线下支付金额。统计使用


    private String remark;//订单备注

    private String confirmMessage;//确认信息
    //采购订单属性
    private Integer userType;//用户类型，采购订单生成时，记录门店还是大客户
    //时间信息
    private Date payTime;//付款时间
    private Date confirmTime;//后台确认收款时间
    private Date sendTime;//配送时间
    private Date receiveTime;//收货时间
    //2017年7月1日 订单商品
    private List<MdlOrderProduct> products;
    public MdlOrder() {

    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getSendType() {
        return sendType;
    }

    public void setSendType(Integer sendType) {
        this.sendType = sendType;
    }

    public String getPayNo() {
        return payNo;
    }

    public void setPayNo(String payNo) {
        this.payNo = payNo;
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getReceiveName() {
        return receiveName;
    }

    public void setReceiveName(String receiveName) {
        this.receiveName = receiveName;
    }

    public String getReceiveMobile() {
        return receiveMobile;
    }

    public void setReceiveMobile(String receiveMobile) {
        this.receiveMobile = receiveMobile;
    }

    public String getReceiveAddress() {
        return receiveAddress;
    }

    public void setReceiveAddress(String receiveAddress) {
        this.receiveAddress = receiveAddress;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }


    public BigDecimal getSendAmount() {
        return sendAmount;
    }

    public void setSendAmount(BigDecimal sendAmount) {
        this.sendAmount = sendAmount;
    }


    public BigDecimal getAliPayAmount() {
        return aliPayAmount;
    }

    public void setAliPayAmount(BigDecimal aliPayAmount) {
        this.aliPayAmount = aliPayAmount;
    }

    public BigDecimal getWechatPayAmount() {
        return wechatPayAmount;
    }

    public void setWechatPayAmount(BigDecimal wechatPayAmount) {
        this.wechatPayAmount = wechatPayAmount;
    }

    public BigDecimal getWechatHtmlPayAmount() {
        return wechatHtmlPayAmount;
    }

    public void setWechatHtmlPayAmount(BigDecimal wechatHtmlPayAmount) {
        this.wechatHtmlPayAmount = wechatHtmlPayAmount;
    }

    public BigDecimal getLinePayAmount() {
        return linePayAmount;
    }

    public void setLinePayAmount(BigDecimal linePayAmount) {
        this.linePayAmount = linePayAmount;
    }

    /*    public BigDecimal getRetailAmount() {
        return retailAmount;
    }

    public void setRetailAmount(BigDecimal retailAmount) {
        this.retailAmount = retailAmount;
    }*/


    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }


    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public Date getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    }

    /**
     * 状态的中文信息
     */
    public String  getTypeStr(){
        String typeStr= "";
        if(type==null)return typeStr;

        switch (type) {
            case 1:
                typeStr="采购订单";
                break;
            case 2:
                typeStr="待定";
                break;
            case 3:
                typeStr="商城订单";
                break;
            default:
                break;
        }
        return typeStr;
    }

    public String  getOrderStatusStr(){
        String orderStatusStr= "";
        if(orderStatus==null)return orderStatusStr;

        switch (orderStatus) {
            case 1:
                orderStatusStr="待付款";
                break;
            case 2:
                orderStatusStr="待配送";
                break;
            case 3:
                orderStatusStr="配送中";
                break;
            case 4:
                orderStatusStr="待评价";
                break;
            case 5:
                orderStatusStr="已评价";
                break;
            case 6:
                orderStatusStr="待退款";
                break;
            case 7:
                orderStatusStr="已退款";
                break;
            case 8:
                orderStatusStr="待退货";
                break;
            case 9:
                orderStatusStr="已退货";
                break;
            case 10:
                orderStatusStr="已取消";
                break;
            default:
                break;
        }
        return orderStatusStr;
    }

    public String getPayTimeStr(){
        if(payTime!=null)return TimeUtils.formatToTime(payTime);
        return null;
    }
    public String getSendTimeStr(){
        if(sendTime!=null)return TimeUtils.formatToTime(sendTime);
        return null;
    }
    public String getReceiveTimeStr(){
        if(receiveTime!=null)return TimeUtils.formatToTime(receiveTime);
        return null;
    }
    public String  getUserTypeStr(){
        String userTypeStr= "";
        if(userType==null)return userTypeStr;
        if(type==3){
            switch (userType) {
                case 2:
                    userTypeStr="门店采购";
                    break;
                case 3:
                    userTypeStr="大客户采购";
                    break;

                default:
                    break;
            }
        }

        return userTypeStr;
    }

    public List<MdlOrderProduct> getProducts() {
        return products;
    }

    public void setProducts(List<MdlOrderProduct> products) {
        this.products = products;
    }

    public Date getConfirmTime() {
        return confirmTime;
    }

    public void setConfirmTime(Date confirmTime) {
        this.confirmTime = confirmTime;
    }

    public Long getSalesManId() {
        return salesManId;
    }

    public void setSalesManId(Long salesManId) {
        this.salesManId = salesManId;
    }

    public String getSalesManName() {
        return salesManName;
    }

    public void setSalesManName(String salesManName) {
        this.salesManName = salesManName;
    }

    public Long getAgentId() {
        return agentId;
    }

    public void setAgentId(Long agentId) {
        this.agentId = agentId;
    }

    public String getAgentName() {
        return agentName;
    }

    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }

    public String getConfirmMessage() {
        return confirmMessage;
    }

    public void setConfirmMessage(String confirmMessage) {
        this.confirmMessage = confirmMessage;
    }
}
